setInfos(3, "Damian : permissions", "Cyber Master Damian will take care of you", "Indica, Doti", "started", 0xFFFFFF, "en", ["long", "femaledom", "formale", "humiliation", "urine", "transgender"]);

def points = 80
if(loadInteger("cybermistress.points")!=null)
	points = loadInteger("cybermistress.points")
if(points>100)
	points = 100
if(points<0)
	points = 0
save("cybermistress.points", points)
def message = "You've got "+points+" points for your attitude. What do you ask for ?"
def permissions = [
	["title":"Receive Training", "chance":75, "interval":500, "points":5, 
		"routine":"train", "deniedMessage":"Your training is not for enjoyment.", "picture":"permissions.jpg"],
	["title":"Masturbate without cuming",
		"chance":55,
		"interval":600,
		"points":-1, 
		"requires":["Stick something in your butt while you do it",
			"Chant \"I'm a dirty whore\" while you do it",
			"Stare into my eyes while you do it",
			"Clamps on your nipples while you do it",
			"2",
			"3",
			"4",
			"5"],
		"flag":["name":"permit_Masturbation","delay":1200],
		"notifflag":"Deny_Masturbate",
		"deniedMessage":"No "+loadString("intro.name")+", you can't masturbate. I own your cock.",
		"picture":"tease.jpg"],
	["title":"Masturbate and cum",
		 "chance":35,
		 "interval":3600,
		 "notifflag":"Deny_Orgasm",
		 "routine":"howtocum",
		 "deniedMessage":"No "+loadString("intro.name")+", you can't cum. I control your orgasms.",
		 "picture":"tease.jpg"],
	["title":"Permission to cum in a session",
		 "chance":35,
		 "interval":3600,
		 "flag":["name":"permit_Orgasm","delay":1200],
		 "notifflag":"Deny_Orgasm",
		 "routine":"howtocum",
		 "deniedMessage":"No "+loadString("intro.name")+", you can't cum. Not here or anywhere else.",
		 "picture":"tease.jpg"],
	 ["title":"Watch Porn",
		 "chance":65,
		 "interval":1200,
		 "deniedMessage":"No my dirty little slave, not right now.",
		 "picture":"tease.jpg"],
	["title":"Wear underwear",
		  "notifflag":"cant_wear_underwear",
		  "chance":50,
		  "interval":1200,
		  "deniedMessage":"Leave them off. It's a good reminder of your place.",
		  "picture":"permissions.jpg"],
	["title":"Take a shower",
		"requires":["Stick something in your butt while you do it",
			"Chant \"I'm a dirty whore\" while you do it",
			"Lay down in the shower and piss all over yourself first",
			"",
			"",
			"",
			"",
			""],
		   "notifflag":"CantTakeShow",
		   "chance":75,
		   "interval":1200,
		   "deniedMessage":"My little slave can stay dirty for now.",
		   "picture":"permissions.jpg"],
	["title":"Use the toilet",
		    "routine":"toilet",
		    "chance":75,
		    "interval":1200,
		    "message":"Very well slave, go see Master Jake for instructions.",
		    "deniedMessage":"Not just yet.\nAsk again in 20 minutes.",
		    "picture":"permissions.jpg"],
	["title":"Use the toilet urgently",
		    "chance":100,
		    "interval":2400,
		    "deniedMessage":"Very well "+loadString("intro.name")+". I am disappointed by your lack of discpline.",
		    "picture":"punishments.jpg"],
	["title":"Eat",
		     "chance":80,
		     "interval":1200,
		     "deniedMessage":"You will go hungry for now.",
		     "picture":"permissions.jpg"],
	["title":"Entertain Myself",
		     "chance":70,
		     "interval":1200,
		     "message":"Very well slave, but it must involve nothing sexual.",
		     "deniedMessage":"You will occupy your time with thoughts of your Master.",
		     "picture":"permissions.jpg"]		    
]

def titles = []
for(def permission:permissions)
	titles.add(permission["title"])

def permission = permissions[getSelectedValue(message, titles)]
def intervalKey = "cybermistress.interval."+permission["title"].replace(" ","_")
if(loadInteger(intervalKey)!=null && loadInteger(intervalKey)>getTime()) {
	show("You asked for this too recently. You think I forgot ?")
	showButton("Sorry, Sir")
	return "jewell"
}

if(100-(2+getRandom(9))*(2+getRandom(9))>=permission["chance"]+points/2|| 
		(permission["notifflag"]!=null && 
				loadInteger("cybermistress."+permission["notifflag"])!=null && 
				loadInteger("cybermistress."+permission["notifflag"])>getTime())) {
	show(permission["deniedMessage"])
	save(intervalKey, getTime()+permission["interval"])
	return "jewell"
}

// Set Lockout Period (if permission granted)
save(intervalKey, getTime()+permission["interval"])

// Set Flag if Specified
if(permission["flag"]!=null)
	save("cybermistress."+permission["flag"]["name"],getTime()+permission["flag"]["delay"])

// Show Specified Picture
if(permission["picture"]!=null)
	setImage("jewell/"+permission["picture"])

// Update slave's attitude points
if(permission["points"]!=null)
	save("cybermistress.points", points+permission["points"])

show("I allow it")
showButton("Thank You, Sir")

// Show Additional Messages


if(permission["requires"]!=null) {
	wait(5)
	show(permission["requires"][getRandom(permission["requires"].size)])
	showButton("Yes, Sir!")
}

// Load specified routine

if(permission["routine"]!=null) {
	wait(5)
	return "jewell/"+permission["routine"]
}


// Return to Main Script

return "jewell"

// This script, from http://ss.deviatenow.com, is protected by this licence : 
// CC by-NC, see http://creativecommons.org/licenses/by-nc/3.0/

